package com.nidu.demo.dict.model;

import com.nidu.demo.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
public class DictData extends BaseEntity {

    /**
     * 主键ID
     */
    private Long id;

    /**
     * 国际化key
     */
    private String i18nKey;

    /**
     * 字典标签
     */
    private String label;

    /**
     * 字典值
     */
    private String value;

    /**
     * 字典类型
     */
    private String dictType;

    /**
     * 颜色
     */
    private String colorType;

    /**
     * css
     */
    private String cssClass;

    /**
     * 备注
     */
    private String remark;

    /**
     * 排序值
     */
    private Integer sortOrder;

    public static DictData create(String label, String value, String dictType, String colorType, String cssClass, String remark, Integer sortOrder) {
        DictData dictData = new DictData();
        dictData.setLabel(label)
                .setValue(value)
                .setDictType(dictType)
                .setColorType(colorType)
                .setCssClass(cssClass)
                .setRemark(remark)
                .setSortOrder(sortOrder);
        return dictData;
    }

    public static DictData update(Long id, String label, String value, String dictType, String colorType, String cssClass, String remark, Integer sortOrder) {
        DictData dictData = new DictData();
        dictData.setId(id)
                .setLabel(label)
                .setValue(value)
                .setDictType(dictType)
                .setColorType(colorType)
                .setCssClass(cssClass)
                .setRemark(remark)
                .setSortOrder(sortOrder);
        return dictData;
    }

}
